package com.boot.swagger;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 接口文档
 * @date 2019/8/16 16:05
 **/
@Slf4j
@EnableConfigurationProperties(SwaggerProperties.class)
@Configuration
public class SwaggerAutoConfiguration {

    SwaggerProperties properties;

    public SwaggerAutoConfiguration(SwaggerProperties properties) {
        this.properties = properties;
    }

    //@Bean
    //public Docket createApi() {
    //    return new Docket(DocumentationType.SWAGGER_2)
    //            .groupName(properties.getGroup())
    //            .apiInfo(apiInfo())
    //            .select()
    //            .apis(RequestHandlerSelectors
    //                    .basePackage(properties.getBasePackage()))
    //            .paths(PathSelectors.any())
    //            .build();
    //}
    //
    //private ApiInfo apiInfo() {
    //    return new ApiInfoBuilder()
    //            .title(properties.getApplicationName() + "接口文档")
    //            .description(properties.getDescription())
    //            .version(properties.getVersion())
    //            .contact(new Contact(properties.getAuthor(),
    //                    properties.getUrl(),
    //                    properties.getEmail()))
    //            .build();
    //}
}
